#ifndef LONGKEY_BASE_COMMAND_LINE_PARSER_INTERNAL_H_
#define LONGKEY_BASE_COMMAND_LINE_PARSER_INTERNAL_H_

#include <Windows.h>
#include <map>
#include <vector>

namespace internal
{
	class CommandLineParserArgs
	{
	public:
		CommandLineParserArgs() {}
		~CommandLineParserArgs() {}

		typedef std::vector<CString> StringVector;
		typedef StringVector::const_iterator StringVectorIter;
		typedef std::map<CString, StringVector> SwitchAndArgumentsMap;
		typedef SwitchAndArgumentsMap::const_iterator SwitchAndArgumentsMapIter;

		// Gets the number of switches in the parsed command line.  Will return 0 for
		// count if a parse has not occurred.
		int GetSwitchCount() const;

		// Returns the switch at a particular index.
		// This is meant for iteration only and is not guaranteed to be in the order
		// of the switches in the parsed command line.
		HRESULT GetSwitchNameAtIndex(int index, CString* switch_name) const;

		// Returns true if a switch with the name switch_name is found.
		bool HasSwitch(const CString& switch_name) const;

		// Returns the number of arguments for switch_name.  Will fail if switch_name
		// is not a valid switch.
		HRESULT GetSwitchArgumentCount(const CString& switch_name, int* count) const;

		// Returns the value of a switch argument at the specified offset.
		// Fails if switch_name is not a valid switch.
		HRESULT GetSwitchArgumentValue(const CString& switch_name,
			int argument_index,
			CString* argument_value) const;

		void Reset();
		HRESULT AddSwitch(const CString& switch_name);
		HRESULT AddSwitchArgument(const CString& switch_name,
			const CString& argument_value);

	private:
		SwitchAndArgumentsMap switch_arguments_;

		DISALLOW_EVIL_CONSTRUCTORS(CommandLineParserArgs);
	};
}

#endif	// LONGKEY_BASE_COMMAND_LINE_PARSER_INTERNAL_H_